<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    // 编写函数map(arr) 把数组中的每一位数字都增加30%，并返回一个新数组
    let arr = [1, 3, 5, 8];

    function map(arr) {
      let newArr = [];
      for (var i = 0; i < arr.length; i++) {
        let re = (arr[i] * 0.3).toFixed(2);
        newArr.push(re)
      }
      return newArr
    }
    let res = map(arr);
    console.log(res);
  </script>
</body>

</html>